package com.dms.modules.product.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品SKU实体类
 */
@Data
@Accessors(chain = true)
@TableName("product_sku")
@ApiModel(value = "商品SKU实体", description = "商品SKU信息")
public class ProductSku {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("SKU ID")
    private Long id;

    @ApiModelProperty("商品ID")
    private Long productId;

    @ApiModelProperty("SKU编码")
    private String skuCode;

    @ApiModelProperty("SKU名称")
    private String skuName;

    @ApiModelProperty("规格值JSON")
    private String specValues;

    @ApiModelProperty("SKU图片")
    private String image;

    @ApiModelProperty("售价")
    private BigDecimal price;

    @ApiModelProperty("库存")
    private Integer stock;

    @ApiModelProperty("销量")
    private Integer sales;

    @ApiModelProperty("状态：0-禁用 1-启用")
    private Integer status;

    @ApiModelProperty("创建时间")

    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")

    private LocalDateTime updateTime;

    @TableLogic
    @ApiModelProperty("是否删除：0-未删除 1-已删除")
    private Integer deleted;

    @ApiModelProperty("锁定库存（下单未支付锁定的库存）")
    private Integer lockStock;

    @ApiModelProperty("预分配库存")
    private Integer preAllocatedStock;

    @Version
    @ApiModelProperty("乐观锁版本号")
    private Integer version;

    @ApiModelProperty("管理员控制状态：0-禁用 1-启用")
    private Integer adminStatus = 1;
} 